<template>
  <div>
    <!-- 轮播图 -->
    <div>
      <uni-swiper-dot
        :info="info"
        :current="current"
        field="content"
        :mode="mode"
      >
        <swiper class="swiper-box" @change="change">
          <swiper-item v-for="(item, index) in info" :key="index">
            <view class="swiper-item" id="item">
              <img :src="item.content" alt="" id="inmg" />
            </view>
          </swiper-item>
        </swiper>
      </uni-swiper-dot>
    </div>

    <!-- 九宫格 -->
    <div class="lunb">
      <div v-for="(item, index) in list" :key="index" @click="Menubar(index)">
        <div class="GongGe">
          <img src="../../static/banner1.jpg" alt="" class="img" />
          <p>快递代取</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      info: [
        {
          content: "static/banner1.jpg",
        },
        {
          content: "static/banner2.jpg",
        },
        {
          content: "static/banner3.jpg",
        },
      ],
      list: [
        { a: 1 },
        { b: 1 },
        { b: 1 },
        { b: 1 },
        { b: 1 },
        { b: 1 },
        { b: 1 },
        { b: 1 },
        { b: 1 },
      ],
      current: 0,
      mode: "round",
    };
  },
  methods: {
    change(e) {
      this.current = e.detail.current;
    },
    Menubar(e) {
      if (e === 0) {
        console.log("跳转页面");
        uni.navigateTo({
          url: "dy1/dy1",
        });
      }
    },
  },
};
</script>

<style lang="less" scoped>
#inmg {
  width: 100%;
  height: 100%;
}
.lunb {
  display: flex;
  flex-wrap: wrap;
  flex: 3;
  box-sizing: border-box;
  margin: 15px;
  justify-content: space-evenly;
  .GongGe {
    // margin: 10px;
    display: flex;
    width: 100px;
    height: 100px;
    margin-bottom: 10px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid rgb(246, 0, 225);
    border-radius: 40%;
    background-color: rgb(53, 227, 10);
    font-weight: 800;
    color: rgb(240, 13, 134);
    .img {
      width: 60px;
      height: 60px;
      border-radius: 50%;
    }
  }
}
</style>